function [InputsStruct] = InsertKnot(newD, i, InputsStruct)
    %反插节点
    %newD 为新节点坐标 i-i+1为插入位置
    oldCtrP = InputsStruct.data;
    oldCtrPnums = InputsStruct.ctrPnums;
    oldw = InputsStruct.w;
    k = InputsStruct.k;
    oldknots = InputsStruct.knots;
    
    %更新控制点 个数 w
    InputsStruct.ctrPnums = oldCtrPnums+1;
    newCtrP = zeros(oldCtrPnums+1,2);
    newW = zeros(1,oldCtrPnums+1);
    newCtrP(1:i,:) = oldCtrP(1:i,:);
    newCtrP(i+1,:) = newD;
    newCtrP(i+2:oldCtrPnums+1,:) = oldCtrP(i+1:end,:);
    newW(1:i) = oldw(1:i);
    newW(i+1) = 1;
    newW(i+2:oldCtrPnums+1) = oldw(i+1:end);
    InputsStruct.data = newCtrP;
    InputsStruct.w = newW;
    %计算新的节点
    newKnots = zeros(1, size(oldknots,2)+1);
    s = oldw(i) * norm(newD - oldCtrP(i,:)) /...
        (oldw(i) * norm(newD - oldCtrP(i,:)) + ...
         oldw(i+1) * norm(newD - oldCtrP(i+1,:)));
    u = oldknots(i+2) + s*(oldknots(i+k+2) - oldknots(i+2));

end